<?php
namespace app\controller;
use app\exception\Failure;
use app\exception\RequestMethodInvalidate;
use app\exception\Success;
use app\facade\logic\Menu as FaMenuLogic;


class Menu extends AuthBase{
    //

    /**
     * del
     * @Route("/menu/del")
     */
    public function del(){
        if($this->request->isPost()){
            $result = FaMenuLogic::del();
            if($result){
                throw new Success();
            }else{
                throw new Failure();
            }
        }
        throw new RequestMethodInvalidate();
    }

    /**
     * update
     * @Route("/menu/update")
     */
    public function update(){
        if($this->request->isPost()){
            $result = FaMenuLogic::update();
            if($result){
                throw new Success();
            }else{
                throw new Failure();
            }
        }
    }

    /**
     * create
     * @Route("/menu/create")
     */
    public function create(){
        if($this->request->isPost()){
            $result = FaMenuLogic::create();
            if($result){
                throw new Success();
            }else{
                throw new Failure();
            }
        }
    }
}
 
